<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
   
   <meta name="description" content="string operations">
    
    <meta name="author" content="John S. Urban" >
    <link rel="icon" href="../favicon.png">

    <title>getvals &ndash; M_strings</title>

    <link href="../css/bootstrap.min.css" rel="stylesheet">
    <link href="../css/pygments.css" rel="stylesheet">
    <link href="../css/font-awesome.min.css" rel="stylesheet">
    <link href="../css/local.css" rel="stylesheet">
    
    <link  href="../tipuesearch/tipuesearch.css" rel="stylesheet">
    
    

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
    
    <script src="../js/jquery-2.1.3.min.js"></script>
    <script src="../js/svg-pan-zoom.min.js"></script>

  </head>

  <body>

    <!-- Fixed navbar -->
    <nav class="navbar navbar-inverse navbar-fixed-top">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="../index.html">M_strings </a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
          <ul class="nav navbar-nav">
        
            <li class="dropdown hidden-xs visible-sm visible-md hidden-lg">
              <a href="#" class="dropdown-toggle"
              data-toggle="dropdown" role="button"
              aria-haspopup="true"
     aria-expanded="false">Contents <span class="caret"></span></a>
        <ul class="dropdown-menu">
          
              
            <li><a href="../lists/files.html">Source Files</a></li>
        
        
        
            <li><a href="../lists/modules.html">Modules</a></li>
        
            
                                
            <li><a href="../lists/procedures.html">Procedures</a></li>
        
               
            <li><a href="../lists/types.html">Derived Types</a></li>
        
        
            </ul>
            </li>


<li class="visible-xs hidden-sm visible-lg"><a href="../lists/files.html">Source Files</a></li>



<li class="visible-xs hidden-sm visible-lg"><a href="../lists/modules.html">Modules</a></li>



<li class="visible-xs hidden-sm visible-lg"><a href="../lists/procedures.html">Procedures</a></li>

                             
<li class="visible-xs hidden-sm visible-lg"><a href="../lists/types.html">Derived Types</a></li>


          </ul>
        
        <form action="../search.html" class="navbar-form navbar-right" role="search">
        <div class="form-group">
          <input type="text" class="form-control" placeholder="Search" name="q" id="tipue_search_input" autocomplete="off" required>
        </div>
<!--
        <button type="submit" class="btn btn-default">Submit</button>
-->
        </form>
        
        </div><!--/.nav-collapse -->
      </div>
    </nav>

    <div class="container">
    
  
  <div class="row">
    <h1>getvals
      <small>Subroutine</small>
    
    </h1>
    
<div class="row">
  <div class="col-lg-12">
<div class="well well-sm">
  <ul class="list-inline" style="margin-bottom:0px;display:inline">
     
     
     
     
    
    
     <li><i class="fa fa-list-ol"></i>
       <a data-toggle="tooltip"
    data-placement="bottom" data-html="true"
    title=" 2.1% of total for procedures.">51 statements</a>
     </li> 
     
     
     
    <li><i class="fa fa-code"></i><a href="../src/M_strings.f90"> Source File</a></li>
     
     
  </ul>
  <ol class="breadcrumb in-well text-right">
  
    
     <li><a href='../sourcefile/m_strings.f90.html'>M_strings.f90</a></li>
    
     <li><a href='../module/m_strings.html'>M_strings</a></li>
    
  
     <li class="active">getvals</li>
  </ol>
</div>
</div>
</div>
<script>
  $(function () {
  $('[data-toggle="tooltip"]').tooltip()
  })
</script>

  </div>
  
  <div class="row">
    <div class="col-md-3 hidden-xs hidden-sm visible-md visible-lg">
    
<div id="sidebar">
  
<h3>Contents</h3>
 



<div class="panel panel-primary">
  <div class="panel-heading text-left"><h3 class="panel-title"><a data-toggle="collapse" href="#vars-0">Variables</a></h3></div>
  <div id="vars-0" class="panel-collapse collapse">
    <div class="list-group">
      
      <a class="list-group-item" href="../proc/getvals.html#variable-buffer">buffer</a>
      
      <a class="list-group-item" href="../proc/getvals.html#variable-i~22">i</a>
      
      <a class="list-group-item" href="../proc/getvals.html#variable-ierr_local~2">ierr_local</a>
      
      <a class="list-group-item" href="../proc/getvals.html#variable-ios~2">ios</a>
      
      <a class="list-group-item" href="../proc/getvals.html#variable-isize">isize</a>
      
      <a class="list-group-item" href="../proc/getvals.html#variable-words">words</a>
      
    </div>
  </div>
</div>




















<div class="panel panel-primary">
  <div class="panel-heading text-left"><h3 class="panel-title">Source Code</h3></div>
  <div class="list-group">
    <a class="list-group-item" href="../proc/getvals.html#src">getvals</a>
  </div>
</div>



</div>

    </div>
    
    <div class="col-md-9" id='text'>
    <h2>
public subroutine getvals(line, values, icount, ierr)
    
    
   
</h2>
    
  


    
    <h2 id="name">NAME</h2>
<div class="codehilite"><pre><span></span><code><span class="n">getvals</span><span class="p">(</span><span class="mi">3</span><span class="n">f</span><span class="p">)</span> <span class="o">-</span> <span class="p">[</span><span class="n">M_strings</span><span class="p">:</span><span class="n">NUMERIC</span><span class="p">]</span> <span class="n">read</span> <span class="n">arbitrary</span> <span class="n">number</span> <span class="n">of</span> <span class="n">REAL</span> <span class="n">values</span>
<span class="n">from</span> <span class="n">a</span> <span class="n">character</span> <span class="n">variable</span> <span class="n">up</span> <span class="n">to</span> <span class="n">size</span> <span class="n">of</span> <span class="n">VALUES</span><span class="p">()</span> <span class="n">array</span>
<span class="p">(</span><span class="n">LICENSE</span><span class="p">:</span><span class="n">PD</span><span class="p">)</span>
</code></pre></div>

<h2 id="synopsis">SYNOPSIS</h2>
<div class="codehilite"><pre><span></span><code>subroutine getvals(line,values,icount,ierr)

 character(len=*),intent(in)  :: line
 class(*),intent(out)         :: values(:)
 integer,intent(out)          :: icount
 integer,intent(out),optional :: ierr
</code></pre></div>

<h2 id="description">DESCRIPTION</h2>
<p>GETVALS(3f) reads a relatively arbitrary number of numeric values from
   a character variable into a REAL array using list-directed input.</p>
<p>NOTE: In this version null values are skipped instead of meaning to leave
         that value unchanged</p>
<div class="codehilite"><pre><span></span><code>    1,,,,,,,2 / reads VALUES=[1.0,2.0]
</code></pre></div>

<p>Per list-directed rules when reading values, allowed delimiters are
   comma, semi-colon and space.</p>
<p>the slash separator can be used to add inline comments.</p>
<div class="codehilite"><pre><span></span><code>    10.1, 20.43e-1 ; 11 / THIS IS TREATED AS A COMMENT
</code></pre></div>

<p>Repeat syntax can be used up to the size of the output array. These are
   equivalent input lines:</p>
<div class="codehilite"><pre><span></span><code>    4*10.0
    10.0, 10.0, 10.0, 10.0
</code></pre></div>

<h2 id="options">OPTIONS</h2>
<p>LINE      A character variable containing the characters representing
             a list of numbers</p>
<h2 id="returns">RETURNS</h2>
<p>VALUES()  array holding numbers read from string. May be of type
             INTEGER, REAL, DOUBLEPRECISION, or CHARACTER. If CHARACTER the
             strings are returned as simple words instead of numeric values.
   ICOUNT    number of defined numbers in VALUES(). If ICOUNT reaches
             the size of the VALUES() array parsing stops.
   IERR      zero if no error occurred in reading numbers. Optional.
             If not present and an error occurs the program is terminated.</p>
<h2 id="examples">EXAMPLES</h2>
<p>Sample program:</p>
<div class="codehilite"><pre><span></span><code>   <span class="nv">program</span> <span class="nv">demo_getvals</span>
   <span class="nv">use</span> <span class="nv">M_strings</span>, <span class="nv">only</span>: <span class="nv">getvals</span>
   <span class="nv">implicit</span> <span class="nv">none</span>
   <span class="nv">integer</span>,<span class="nv">parameter</span>  :: <span class="nv">longest_line</span><span class="o">=</span><span class="mi">256</span>
   <span class="nv">character</span><span class="ss">(</span><span class="nv">len</span><span class="o">=</span><span class="nv">longest_line</span><span class="ss">)</span> :: <span class="nv">line</span>
   <span class="nv">real</span>               :: <span class="nv">values</span><span class="ss">(</span><span class="nv">longest_line</span><span class="o">/</span><span class="mi">2</span><span class="o">+</span><span class="mi">1</span><span class="ss">)</span>
   <span class="nv">integer</span>            :: <span class="nv">ios</span>,<span class="nv">icount</span>,<span class="nv">ierr</span>
   <span class="nv">INFINITE</span>: <span class="k">do</span>
      <span class="nv">read</span><span class="ss">(</span><span class="o">*</span>,<span class="s1">&#39;</span><span class="s">(a)</span><span class="s1">&#39;</span>,<span class="nv">iostat</span><span class="o">=</span><span class="nv">ios</span><span class="ss">)</span> <span class="nv">line</span>
      <span class="k">if</span><span class="ss">(</span><span class="nv">ios</span>.<span class="nv">ne</span>.<span class="mi">0</span><span class="ss">)</span><span class="k">exit</span> <span class="nv">INFINITE</span>
      <span class="k">call</span> <span class="nl">getvals</span><span class="ss">(</span><span class="nv">line</span>,<span class="nv">values</span>,<span class="nv">icount</span>,<span class="nv">ierr</span><span class="ss">)</span>
      <span class="nv">write</span><span class="ss">(</span><span class="o">*</span>,<span class="s1">&#39;</span><span class="s">(4(g0,1x))</span><span class="s1">&#39;</span><span class="ss">)</span><span class="s1">&#39;</span><span class="s">VALUES=</span><span class="s1">&#39;</span>,<span class="nv">values</span><span class="ss">(</span>:<span class="nv">icount</span><span class="ss">)</span>
   <span class="nv">enddo</span> <span class="nv">INFINITE</span>
   <span class="k">end</span> <span class="nv">program</span> <span class="nv">demo_getvals</span>
</code></pre></div>

<p>Sample input lines</p>
<div class="codehilite"><pre><span></span><code>    10,20 30.4
    1 2 3
    1

    3 4*2.5 8
    32.3333 / comment 1
    30e3;300,    30.0, 3
    even 1 like this! 10
    11,,,,22,,,,33
</code></pre></div>

<p>Expected output:</p>
<div class="codehilite"><pre><span></span><code><span class="w"> </span><span class="k">VALUES</span><span class="o">=</span><span class="w">   </span><span class="mf">10.0000000</span><span class="w">       </span><span class="mf">20.0000000</span><span class="w">       </span><span class="mf">30.3999996</span><span class="w"></span>
<span class="w"> </span><span class="k">VALUES</span><span class="o">=</span><span class="w">   </span><span class="mf">1.00000000</span><span class="w">       </span><span class="mf">2.00000000</span><span class="w">       </span><span class="mf">3.00000000</span><span class="w"></span>
<span class="w"> </span><span class="k">VALUES</span><span class="o">=</span><span class="w">   </span><span class="mf">1.00000000</span><span class="w"></span>
<span class="w"> </span><span class="k">VALUES</span><span class="o">=</span><span class="w"></span>
<span class="w"> </span><span class="k">VALUES</span><span class="o">=</span><span class="w">   </span><span class="mf">3.00000000</span><span class="w">       </span><span class="mf">2.50000000</span><span class="w">       </span><span class="mf">2.50000000</span><span class="w"></span>
<span class="w"> </span><span class="mf">2.50000000</span><span class="w">       </span><span class="mf">2.50000000</span><span class="w">       </span><span class="mf">8.00000000</span><span class="w"></span>
<span class="w"> </span><span class="k">VALUES</span><span class="o">=</span><span class="w">   </span><span class="mf">32.3333015</span><span class="w"></span>
<span class="w"> </span><span class="k">VALUES</span><span class="o">=</span><span class="w">   </span><span class="mf">30000.0000</span><span class="w">       </span><span class="mf">300.000000</span><span class="w">       </span><span class="mf">30.0000000</span><span class="w"></span>
<span class="w"> </span><span class="mf">3.00000000</span><span class="w"></span>
<span class="w"> </span><span class="o">*</span><span class="n">getvals</span><span class="o">*</span><span class="w"> </span><span class="nl">WARNING</span><span class="p">:</span><span class="o">[</span><span class="n">even</span><span class="o">]</span><span class="w"> </span><span class="k">is</span><span class="w"> </span><span class="ow">not</span><span class="w"> </span><span class="n">a</span><span class="w"> </span><span class="n">number</span><span class="w"></span>
<span class="w"> </span><span class="o">*</span><span class="n">getvals</span><span class="o">*</span><span class="w"> </span><span class="nl">WARNING</span><span class="p">:</span><span class="o">[</span><span class="n">like</span><span class="o">]</span><span class="w"> </span><span class="k">is</span><span class="w"> </span><span class="ow">not</span><span class="w"> </span><span class="n">a</span><span class="w"> </span><span class="n">number</span><span class="w"></span>
<span class="w"> </span><span class="o">*</span><span class="n">getvals</span><span class="o">*</span><span class="w"> </span><span class="nl">WARNING</span><span class="p">:</span><span class="o">[</span><span class="n">this!</span><span class="o">]</span><span class="w"> </span><span class="k">is</span><span class="w"> </span><span class="ow">not</span><span class="w"> </span><span class="n">a</span><span class="w"> </span><span class="n">number</span><span class="w"></span>
<span class="w"> </span><span class="k">VALUES</span><span class="o">=</span><span class="w">   </span><span class="mf">1.00000000</span><span class="w">       </span><span class="mf">10.0000000</span><span class="w"></span>
<span class="w"> </span><span class="k">VALUES</span><span class="o">=</span><span class="w">   </span><span class="mf">11.0000000</span><span class="w">       </span><span class="mf">22.0000000</span><span class="w">       </span><span class="mf">33.0000000</span><span class="w"></span>
</code></pre></div>

<h2 id="author">AUTHOR</h2>
<div class="codehilite"><pre><span></span><code>John S. Urban
</code></pre></div>

<h2 id="license">LICENSE</h2>
<div class="codehilite"><pre><span></span><code>Public Domain
</code></pre></div>
    

    <h3>Arguments</h3>
    
      
<table class="table table-striped varlist">
<thead><tr><th>Type</th>
<th>Intent</th><th>Optional</th>
<th>Attributes</th><th></th><th>Name</th><th></th></thead>



<tbody>

  
  
  
  
<tr>
  
  <td><span class="anchor" id="variable-line~9"></span>character(len=*),</td>
  <td>intent(in)</td>
  <td></td>
  
  <td></td><td>::</td>
  <td><strong>line</strong></td><td></td>
  
</tr>

  
  
  
  
<tr>
  
  <td><span class="anchor" id="variable-values"></span>class(*),</td>
  <td>intent(out)</td>
  <td></td>
  
  <td></td><td>::</td>
  <td><strong>values</strong>(:)</td><td></td>
  
</tr>

  
  
  
  
<tr>
  
  <td><span class="anchor" id="variable-icount~4"></span>integer,</td>
  <td>intent(out)</td>
  <td></td>
  
  <td></td><td>::</td>
  <td><strong>icount</strong></td><td></td>
  
</tr>

  
  
  
  
<tr>
  
  <td><span class="anchor" id="variable-ierr~5"></span>integer,</td>
  <td>intent(out),</td>
  <td>optional</td>
  
  <td></td><td>::</td>
  <td><strong>ierr</strong></td><td></td>
  
</tr>

</tbody>
</table>

    
    
    
    
     
    <br>

    <section class="visible-xs visible-sm hidden-md">
      
<h3>Contents</h3>
 



<div class="panel panel-primary">
  <div class="panel-heading text-left"><h3 class="panel-title"><a data-toggle="collapse" href="#vars-1">Variables</a></h3></div>
  <div id="vars-1" class="panel-collapse collapse">
    <div class="list-group">
      
      <a class="list-group-item" href="../proc/getvals.html#variable-buffer">buffer</a>
      
      <a class="list-group-item" href="../proc/getvals.html#variable-i~22">i</a>
      
      <a class="list-group-item" href="../proc/getvals.html#variable-ierr_local~2">ierr_local</a>
      
      <a class="list-group-item" href="../proc/getvals.html#variable-ios~2">ios</a>
      
      <a class="list-group-item" href="../proc/getvals.html#variable-isize">isize</a>
      
      <a class="list-group-item" href="../proc/getvals.html#variable-words">words</a>
      
    </div>
  </div>
</div>




















<div class="panel panel-primary">
  <div class="panel-heading text-left"><h3 class="panel-title">Source Code</h3></div>
  <div class="list-group">
    <a class="list-group-item" href="../proc/getvals.html#src">getvals</a>
  </div>
</div>



    </section>
    <br class="visible-xs visible-sm hidden-md">

    

    
    <section>    
      <h2>Variables</h2>
    
<table class="table table-striped varlist">
<thead><tr><th>Type</th><th>Visibility</th>

<th>Attributes</th><th></th><th>Name</th><th></th><th>Initial</th><th></th></thead>



<tbody>

  
  
  
  
<tr>
  
  <td><span class="anchor" id="variable-buffer"></span>character(len=:),</td>
  
  <td>public,</td>
  <td>allocatable</td><td>::</td>
  <td><strong>buffer</strong></td><td></td><td></td><td></td>
  
</tr>

  
  
  
  
<tr>
  
  <td><span class="anchor" id="variable-i~22"></span>integer,</td>
  
  <td>public</td>
  <td></td><td>::</td>
  <td><strong>i</strong></td><td></td><td></td><td></td>
  
</tr>

  
  
  
  
<tr>
  
  <td><span class="anchor" id="variable-ierr_local~2"></span>integer,</td>
  
  <td>public</td>
  <td></td><td>::</td>
  <td><strong>ierr_local</strong></td><td></td><td></td><td></td>
  
</tr>

  
  
  
  
<tr>
  
  <td><span class="anchor" id="variable-ios~2"></span>integer,</td>
  
  <td>public</td>
  <td></td><td>::</td>
  <td><strong>ios</strong></td><td></td><td></td><td></td>
  
</tr>

  
  
  
  
<tr>
  
  <td><span class="anchor" id="variable-isize"></span>integer,</td>
  
  <td>public</td>
  <td></td><td>::</td>
  <td><strong>isize</strong></td><td></td><td></td><td></td>
  
</tr>

  
  
  
  
<tr>
  
  <td><span class="anchor" id="variable-words"></span>character(len=len(line)),</td>
  
  <td>public</td>
  <td></td><td>::</td>
  <td><strong>words</strong>(size(values))</td><td></td><td></td><td></td>
  
</tr>

</tbody>
</table>

    </section>
    <br>
    
    
    
    
    

    
    
    
    
    


    
    
    
    <section>
    <h2><span class="anchor" id="src"></span>Source Code</h2>
    <div class="highlight"><pre><span></span><span class="k">subroutine </span><span class="n">getvals</span><span class="p">(</span><span class="n">line</span><span class="p">,</span><span class="n">values</span><span class="p">,</span><span class="n">icount</span><span class="p">,</span><span class="n">ierr</span><span class="p">)</span>
<span class="k">implicit none</span>

<span class="c">! ident_55=&quot;@(#)M_strings::getvals(3f): read arbitrary number of values from a character variable&quot;</span>

<span class="c">! JSU 20170831</span>

<span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=*</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">in</span><span class="p">)</span>  <span class="kd">::</span> <span class="n">line</span>
<span class="k">class</span><span class="p">(</span><span class="o">*</span><span class="p">),</span><span class="k">intent</span><span class="p">(</span><span class="n">out</span><span class="p">)</span>         <span class="kd">::</span> <span class="n">values</span><span class="p">(:)</span>
<span class="kt">integer</span><span class="p">,</span><span class="k">intent</span><span class="p">(</span><span class="n">out</span><span class="p">)</span>          <span class="kd">::</span> <span class="n">icount</span>
<span class="kt">integer</span><span class="p">,</span><span class="k">intent</span><span class="p">(</span><span class="n">out</span><span class="p">),</span><span class="k">optional</span> <span class="kd">::</span> <span class="n">ierr</span>

<span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=</span><span class="p">:),</span><span class="k">allocatable</span> <span class="kd">::</span> <span class="n">buffer</span>
<span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=</span><span class="nb">len</span><span class="p">(</span><span class="n">line</span><span class="p">))</span>     <span class="kd">::</span> <span class="n">words</span><span class="p">(</span><span class="n">size</span><span class="p">(</span><span class="n">values</span><span class="p">))</span>
<span class="kt">integer</span>                      <span class="kd">::</span> <span class="n">ios</span><span class="p">,</span> <span class="n">i</span><span class="p">,</span> <span class="n">ierr_local</span><span class="p">,</span><span class="n">isize</span>

   <span class="n">isize</span><span class="o">=</span><span class="mi">0</span>
   <span class="k">select type</span><span class="p">(</span><span class="n">values</span><span class="p">)</span>
   <span class="k">type is</span> <span class="p">(</span><span class="kt">integer</span><span class="p">);</span>          <span class="n">isize</span><span class="o">=</span><span class="n">size</span><span class="p">(</span><span class="n">values</span><span class="p">)</span>
   <span class="k">type is</span> <span class="p">(</span><span class="kt">real</span><span class="p">);</span>             <span class="n">isize</span><span class="o">=</span><span class="n">size</span><span class="p">(</span><span class="n">values</span><span class="p">)</span>
   <span class="k">type is</span> <span class="p">(</span><span class="n">doubleprecision</span><span class="p">);</span>  <span class="n">isize</span><span class="o">=</span><span class="n">size</span><span class="p">(</span><span class="n">values</span><span class="p">)</span>
   <span class="k">type is</span> <span class="p">(</span><span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=*</span><span class="p">));</span> <span class="n">isize</span><span class="o">=</span><span class="n">size</span><span class="p">(</span><span class="n">values</span><span class="p">)</span>
   <span class="k">end select</span>

<span class="k">   </span><span class="n">ierr_local</span><span class="o">=</span><span class="mi">0</span>

   <span class="n">words</span><span class="o">=</span><span class="s1">&#39; &#39;</span>                            <span class="c">! make sure words() is initialized to null+blanks</span>
   <span class="n">buffer</span><span class="o">=</span><span class="nb">trim</span><span class="p">(</span><span class="n">unquote</span><span class="p">(</span><span class="n">line</span><span class="p">))</span><span class="o">//</span><span class="s2">&quot;/&quot;</span>      <span class="c">! add a slash to the end so how the read behaves with missing values is clearly defined</span>
   <span class="k">read</span><span class="p">(</span><span class="n">buffer</span><span class="p">,</span><span class="o">*</span><span class="p">,</span><span class="n">iostat</span><span class="o">=</span><span class="n">ios</span><span class="p">)</span> <span class="n">words</span>      <span class="c">! undelimited strings are read into an array</span>
   <span class="n">icount</span><span class="o">=</span><span class="mi">0</span>
   <span class="k">do </span><span class="n">i</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span><span class="n">isize</span>                         <span class="c">! loop thru array and convert non-blank words to numbers</span>
      <span class="k">if</span><span class="p">(</span><span class="n">words</span><span class="p">(</span><span class="n">i</span><span class="p">).</span><span class="n">eq</span><span class="p">.</span><span class="s1">&#39; &#39;</span><span class="p">)</span><span class="k">cycle</span>

<span class="k">      select type</span><span class="p">(</span><span class="n">values</span><span class="p">)</span>
      <span class="k">type is</span> <span class="p">(</span><span class="kt">integer</span><span class="p">);</span>          <span class="k">read</span><span class="p">(</span><span class="n">words</span><span class="p">(</span><span class="n">i</span><span class="p">),</span><span class="o">*</span><span class="p">,</span><span class="n">iostat</span><span class="o">=</span><span class="n">ios</span><span class="p">)</span><span class="n">values</span><span class="p">(</span><span class="n">icount</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span>
      <span class="k">type is</span> <span class="p">(</span><span class="kt">real</span><span class="p">);</span>             <span class="k">read</span><span class="p">(</span><span class="n">words</span><span class="p">(</span><span class="n">i</span><span class="p">),</span><span class="o">*</span><span class="p">,</span><span class="n">iostat</span><span class="o">=</span><span class="n">ios</span><span class="p">)</span><span class="n">values</span><span class="p">(</span><span class="n">icount</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span>
      <span class="k">type is</span> <span class="p">(</span><span class="n">doubleprecision</span><span class="p">);</span>  <span class="k">read</span><span class="p">(</span><span class="n">words</span><span class="p">(</span><span class="n">i</span><span class="p">),</span><span class="o">*</span><span class="p">,</span><span class="n">iostat</span><span class="o">=</span><span class="n">ios</span><span class="p">)</span><span class="n">values</span><span class="p">(</span><span class="n">icount</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span>
      <span class="k">type is</span> <span class="p">(</span><span class="kt">character</span><span class="p">(</span><span class="nb">len</span><span class="o">=*</span><span class="p">));</span> <span class="n">values</span><span class="p">(</span><span class="n">icount</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span><span class="o">=</span><span class="n">words</span><span class="p">(</span><span class="n">i</span><span class="p">)</span>
      <span class="k">end select</span>

<span class="k">      if</span><span class="p">(</span><span class="n">ios</span><span class="p">.</span><span class="n">eq</span><span class="p">.</span><span class="mi">0</span><span class="p">)</span><span class="k">then</span>
<span class="k">         </span><span class="n">icount</span><span class="o">=</span><span class="n">icount</span><span class="o">+</span><span class="mi">1</span>
      <span class="k">else</span>
<span class="k">         </span><span class="n">ierr_local</span><span class="o">=</span><span class="n">ios</span>
         <span class="k">write</span><span class="p">(</span><span class="n">ERROR_UNIT</span><span class="p">,</span><span class="o">*</span><span class="p">)</span><span class="s1">&#39;*getvals* WARNING:[&#39;</span><span class="o">//</span><span class="nb">trim</span><span class="p">(</span><span class="n">words</span><span class="p">(</span><span class="n">i</span><span class="p">))</span><span class="o">//</span><span class="s1">&#39;] is not a number of specified type&#39;</span>
      <span class="k">endif</span>
<span class="k">   enddo</span>

<span class="k">   if</span><span class="p">(</span><span class="nb">present</span><span class="p">(</span><span class="n">ierr</span><span class="p">))</span><span class="k">then</span>
<span class="k">      </span><span class="n">ierr</span><span class="o">=</span><span class="n">ierr_local</span>
   <span class="n">elseif</span><span class="p">(</span><span class="n">ierr_local</span><span class="p">.</span><span class="n">ne</span><span class="p">.</span><span class="mi">0</span><span class="p">)</span><span class="k">then</span>        <span class="c">! error occurred and not returning error to main program to print message and stop program</span>
      <span class="k">write</span><span class="p">(</span><span class="n">ERROR_UNIT</span><span class="p">,</span><span class="o">*</span><span class="p">)</span><span class="s1">&#39;*getval* error reading line [&#39;</span><span class="o">//</span><span class="nb">trim</span><span class="p">(</span><span class="n">line</span><span class="p">)</span><span class="o">//</span><span class="s1">&#39;]&#39;</span>
      <span class="k">stop </span><span class="mi">2</span>
   <span class="k">endif</span>

<span class="k">end subroutine </span><span class="n">getvals</span>
</pre></div>

    </section>
    <br>
    
    
    </div>
  </div>


    <hr>    
    </div> <!-- /container -->
    <footer>
      <div class="container">
      <div class="row">
        <div class="col-xs-6 col-md-4"><p>&copy; 2022 
                                          </p></div>
        <div class="col-xs-6 col-md-4 col-md-push-4">
          <p class="text-right">
            Documentation generated by 
            <a href="https://github.com/cmacmackin/ford">FORD</a>
             on 2022-01-16 22:32  
          </p>
        </div>
        <div class="col-xs-12 col-md-4 col-md-pull-4"><p class="text-center"> M_strings was developed by John S. Urban</p></div>
      </div>
      <br>
      </div> <!-- /container -->    
    </footer>

    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
<!--
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
-->
    <script src="../js/bootstrap.min.js"></script>
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <script src="../js/ie10-viewport-bug-workaround.js"></script>

    <!-- MathJax JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script type="text/x-mathjax-config">
      MathJax.Hub.Config({
        TeX: { extensions: ['AMSmath.js','AMSsymbols.js','noErrors.js','noUndefined.js'], equationNumbers: { autoNumber: 'AMS' } },
        jax: ['input/TeX','input/MathML','output/HTML-CSS'],
        extensions: ['tex2jax.js','mml2jax.js','MathMenu.js','MathZoom.js']
      });
    </script>
    
    <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
    
    
    <script src="../tipuesearch/tipuesearch_content.js"></script>
    <script src="../tipuesearch/tipuesearch_set.js"></script>
    <script src="../tipuesearch/tipuesearch.js"></script>
    
    
  </body>
</html>